package com.tarena.lbs.content.pojo.po;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.util.Date;

@Data
@ToString
@Document(indexName = "lbs_article")
@Setting(shards = 1, replicas = 0)
public class ArticleSearchPO {
	
	@Id
	@Field(type = FieldType.Integer)
	private Integer id; // 文章ID
	
	@Field(type = FieldType.Text)
	private String articleTitle; // 文章标题
	
	@Field(type = FieldType.Integer)
	private Integer articleCategoryId; // 文章分类ID
	
	@Field(type = FieldType.Keyword)
	private String articleLabel; // 文章标签
	
	@Field(type = FieldType.Text)
	private String articleDigest; // 文章摘要
	
	@Field(type = FieldType.Keyword)
	private String articleUsername; // 文章作者
	
	@Field(type = FieldType.Keyword)
	private String articleCover; // 文章封面
	
	@Field(type = FieldType.Keyword)
	private String articleMainPic; // 文章主图
	
	@Field(type = FieldType.Text)
	private String articleDetail; // 文章详情
	
	@Field(type = FieldType.Integer)
	private Integer shopId; // 店铺ID
	
	@Field(type = FieldType.Text)
	private String activityWord; // 活动标语
	
	@Field(type = FieldType.Integer)
	private Integer activityId; // 活动ID
	
	@Field(type = FieldType.Text)
	private String latitude; // 纬度
	
	@GeoPointField
	private String location; // 位置
	
	@Field(type = FieldType.Text)
	private String longitude; // 经度
	
	@Field(type = FieldType.Integer)
	private Integer articleStatus; // 文章状态
	
	@Field(type = FieldType.Integer)
	private Integer accessCount; // 访问量
	
	@Field(type = FieldType.Integer)
	private Integer likeCount; // 点赞量
	
	@Field(type = FieldType.Integer)
	private Integer favoriteCount; // 收藏量
	
	@Field(type = FieldType.Integer)
	private Integer userId; // 用户ID
	
	@Field(type = FieldType.Integer)
	private Integer source; // 来源
	
	@Field(type = FieldType.Date, format = {DateFormat.date_hour_minute_second})
	private Date createTime; // 创建时间
	
	@Field(type = FieldType.Date, format = {DateFormat.date_hour_minute_second})
	private Date updateTime; // 更新时间
	
}
